import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common';
import { SysRoleService } from './sys-role.service';
import { CreateSysRoleDto } from './dto/create-sys-role.dto';
import { UpdateSysRoleDto } from './dto/update-sys-role.dto';

@Controller('sys-role')
export class SysRoleController {
  constructor(private readonly sysRoleService: SysRoleService) {}

  @Post()
  create(@Body() createSysRoleDto: CreateSysRoleDto) {
    return this.sysRoleService.create(createSysRoleDto);
  }

  @Get()
  findAll() {
    return this.sysRoleService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.sysRoleService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateSysRoleDto: UpdateSysRoleDto) {
    return this.sysRoleService.update(+id, updateSysRoleDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.sysRoleService.remove(+id);
  }
}
